

package com.hazelcast.vector;

import com.hazelcast.spi.annotation.Beta;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

/**
 * Single vector search result
 *
 * @param <K>
 * @param <V>
 * @since 5.5
 */
@Beta
public interface SearchResult<K, V> {

    /**
     * @return id of the document
     */
    @Nonnull
    K getKey();

    /**
     * @return the complete document value, if it was requested to be included, otherwise
     * {@code null}
     * @see SearchOptions#isIncludeValue()
     */
    @Nullable
    V getValue();

    /**
     * @return the document's vectors, if requested to be included, otherwise {@code null}
     * @see SearchOptions#isIncludeVectors()
     */
    @Nullable
    VectorValues getVectors();

    float getScore();
}
